﻿using System.Security.Cryptography;
using System.Text;

namespace RuoYi.Framework.DataEncryption;

/// <summary>
/// BCryptPassword 加密
/// </summary>
[SuppressSniffer]
public static class BCryptPasswordEncryption
{
    public static string HashPassword(string password)
    {
        return BCrypt.Net.BCrypt.HashPassword(password, workFactor: 12);
    }

    public static bool VerifyPassword(string hashedPassword, string providedPassword)
    {
        return BCrypt.Net.BCrypt.Verify(providedPassword, hashedPassword);
    }

}